<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ page import="edu.sctu.Database" %>
<%@ page import="edu.sctu.User" %>
<%@ page import="java.util.List" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: 1
  Date: 2018/5/18
  Time: 15:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录处理</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    if (username != null && password!= null) {
        if (("john".equals(username)) && ("123456".equals(password))) {
            response.setHeader("refresh", "0.5;URL=userList.jsp");
            session.setAttribute("user.id", username);
%>
<h3>用户登录成功0.5秒后会自动跳转到用户列表页!</h3>
如果没有跳转请按
<a href="login.jsp">这里</a>跳转
<%
} else {
%>
<h3>登录失败</h3>
<%
        }
    }
%>

</body>
</html>
